package com.tianlang.service.impl;

import com.tianlang.domain.pojo.Account;
import com.tianlang.service.IUserManager;

import java.util.List;

import org.springframework.stereotype.Service;

/**
 * 
 * @author mchp
 *
 */
@Service("userManager")
@SuppressWarnings({ "unchecked" })
public class UserManager extends BaseManager implements IUserManager {

	public Account getAccountByName(String username) {
		List<Account> _list = super.getListByWhere("from Account where username=? order by checked desc",
				new Object[] { username }, 0, 1);
		if (_list == null) {
			return null;
		}
		return _list.size() == 1 ? _list.get(0) : null;
	}

}
